#
# This file is a part of the open-eBackup project.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at
# http://mozilla.org/MPL/2.0/.
#
# Copyright (c) [2024] Huawei Technologies Co.,Ltd.
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#

class ExecCmdResult:
    SUCCESS = "0"
    ERROR = "-1"
    UNKNOWN_CMD = "-2"


class ParamField:
    JOB = "job"
    JOB_ID = "jobId"
    REPOSITORIES = "repositories"
    PATH = "path"
    INSTANCE = "instance"
    ENDPOINT = "endpoint"
    JOB_PARAM = "jobParam"
    BACKUP_TYPE = "backupType"
    PROTECT_OBJECT = "protectObject"
    TYPE = "type"
    SUB_TYPE = "subType"
    DATABASE = "database"
    PORT = "port"
    NAME = "name"
    ID = "id"
    REPOSITORY_TYPE = "repositoryType"
    ENV_FILE = "envPath"
    CLUSTER_VERSION = "clusterVersion"
    PROTECT_ENV = "protectEnv"
    EXTEND_INFO = "extendInfo"
    COPY = "copy"
    COPYIES = "copies"
    TIMESTAMP = "timestamp"
    PARENT_NAME = "parentName"
    TARGET_OBJECT = "targetObject"
    TARGET_ENV = "targetEnv"
    NEW_NAME = "newName"
    AUTH = "auth"
    EXTEND_AUTH = "extendAuth"
    ESN_ID = "esnId"
    REMOTE_PATH = "remotePath"
    DATA = "data"
    CHANNEL_NUMBER = "channel_number"
    APP_ENV = "appEnv"
    APPLICATION = "application"
    AUTH_KEY = "authKey"
    APPLICATIONS = "applications"
    NODES = "nodes"
    HADR_ROLE = "HADR_ROLE"
    SUBJOB = "subJob"
    JOBNAME = "jobName"
    BACKUP_TIMESTAMP = "backupImageTimestamp"
    RESTORE_TIMESTAMP = "restoreTimestamp"
    TARGETLOCATION = "targetLocation"
    LOCAL_DATABASE_DIRECTORY = "localDatabaseDirectory"
    UUID = "uuid"
    ARCHIVE_COPY_ID = "copy_id"
    DATA_PATH = "data_path"
    RESTORE_TIME = "restore_time"
    NODE_DATABASE = "nodeDatabase"
    DATABASE_NMAE = "database_name"
    TABLESPACE_INFO = "tablespace_info"
    TABLE_INFO = "table_info"


# 操作系统列表
DEPLOY_OPERATING_SYSTEMS = (
    "Red Hat",
    "CentOS",
    "SUSE"
)

# 系统列表
DEPLOY_PLAT = (
    "Linux",
    "Windows",
    "AIX"
)


class DB2Type:
    TYPE = "Database"
    DB2INSTANCE = "DB2-instance"
    DB2CLUSTERINSTANCE = "DB2-clusterInstance"
    DB2DATABASE = "DB2-database"
    DB2TABLESPACE = "DB2-tablespace"


class ClusterType:
    POWERHA = "powerHA"
    PDF = "dpf"
    SINGLE = "single"
    HADR = "hadr"


class HadrRoleType:
    PRIMARY = "PRIMARY"
    STANDBY = "STANDBY"


class HadrStateType:
    PEER = "PEER"
    REMOTE_CATCHUP = "REMOTE_CATCHUP"


class HadrConnectStatus:
    CONNECTED = "CONNECTED"
    DISCONNECTED = "DISCONNECTED"


class HadrCfgField:
    ROLE = "HADR_ROLE"
    STATE = "HADR_STATE"
    REMOTE_HOST = "HADR_REMOTE_HOST"
    REMOTE_SVC = "HADR_REMOTE_SVC"
    REMOTE_INST = "HADR_REMOTE_INST"
    LOCAL_HOST = "HADR_LOCAL_HOST"
    LOCAL_SVC = "HADR_LOCAL_SVC"
    TARGET_LIST = "HADR_TARGET_LIST"
    CONNECT_STATUS = "HADR_CONNECT_STATUS"


class HadrRestoreSubjobName:
    CHECK = "check"
    STOP = "stop"
    RESTORE = "restore"
    START = "start"


class ReplicationType:
    REVERSE_REPLICATION = 'reverseReplication'  # 反向复制
    NORMAL_REPLICATION = 'normalReplication'  # 复制
